<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateJobApplyTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('job_apply', function (Blueprint $table) {
//            $table->comment('岗位竞聘申请表');
            $table->integer('id', true);
            $table->integer('job_id');
            $table->integer('data_version_id');
            $table->string('data_version_name', 50)->default('');
            $table->string('name', 25)->default('')->comment('教师姓名');
            $table->dateTime('join_job_date')->nullable()->comment('参加工作时间');
            $table->string('old_level', 5)->default('')->comment('原岗位等级');
            $table->string('old_level_name', 25)->default('')->comment('原岗位等级名称');
            $table->dateTime('engage_date')->nullable()->comment('原岗位聘用时间');
            $table->string('apply_level', 5)->default('')->comment('申请岗位等级');
            $table->string('apply_level_name', 25)->default('')->comment('申请岗位等级名称');
            $table->string('subject', 255)->comment('任教学科');
            $table->timestamp('created_at')->nullable()->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable()->useCurrent();
            $table->integer('user_id')->comment('申报人id');
            $table->string('education', 5)->default('')->comment('学历');
            $table->string('education_name', 25)->comment('学历名称');
            $table->boolean('training')->default(false)->comment('“十三五”360培训 1-完成 2-未完成');
            $table->integer('teaching_age')->default(0)->comment('教龄');
            $table->integer('engage_age')->default(0)->comment('职称聘任年限');
            $table->text('remark')->comment('申报理由');
            $table->boolean('status')->default(false)->comment('状态 0-保存 1-提交');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('job_apply');
    }
};
